package top.chj.day17.exam.test2;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

/**
 * @Auther:小陈的Java
 */
//实现Callable
public class Demo4 {
    public static void main(String[] args) throws Exception{
        FutureTask task = new FutureTask(new ClallDemo());
        new Thread(task).start();
        Object result = task.get();
        System.out.println(result);
    }
}
class ClallDemo implements Callable {
    @Override
    public Object call() throws Exception {
        System.out.println("实现Callable方式");
        return "success";
    }
}